﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TARLib
{
    public class DettagliDisponibilitaProdotto
    {
        public DettagliDisponibilitaProdotto(DateTime? timeStampLimite, int? limite, int? inCoda, int? locked)
        {
            TimeStampLimite = timeStampLimite;
            Limite = limite;
            InCoda = inCoda;
            Locked = locked;
        }

        public DateTime? TimeStampLimite { get; set; }
        public int? Limite { get; set; }
        public int? InCoda { get; set; }
        public int? Locked { get; set; }

        public bool IsDisponibile
        {
            get
            {
                if (!Limite.HasValue)
                    return true;
                else
                    return (Limite - InCoda - Locked) > 0;
            }
        }
    }
}